package com.moss.cloud.base.api.model.param;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.moss.cloud.common.core.model.param.PageParam;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class UserPageParam extends PageParam implements Serializable {
    public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    /** 用户名 */
    private String username;
    /** 用户姓名 */
    private String name;
    /** 用户手机 */
    private String mobile;
    /** 是否未锁定 */
    private Boolean accountNonLocked;
    /** 用户邮箱 */
    private String email;
    /** 用户性别（0男，1女） */
    private Integer sex;
    /** 创建开始时间 */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = DATE_FORMAT)
    private LocalDateTime startTime;
    /** 创建结束时间 */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = DATE_FORMAT)
    private LocalDateTime endTime;
    /** 部门Id */
    private Long deptId;
}
